package com.ruoyi.common.core.domain.model;

import cn.hutool.json.JSONObject;
import com.alibaba.fastjson2.annotation.JSONField;
import com.ruoyi.common.core.domain.entity.SysUser;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Set;

/**
 * @author ruoyi
 */
@Data
public class PhoneUserCode {

    private String name;
    /**
     * phone
     */
    private String phone;
    private String code;
    private String time;
    private Long sendTime;

    // Getter / Setter / toString
    public static PhoneUserCode fromJson(JSONObject json) {
        PhoneUserCode userCode = new PhoneUserCode();
        userCode.setPhone(json.getStr("phone"));
        userCode.setCode(json.getStr("code"));
        userCode.setSendTime(json.getLong("sendTime"));
        return userCode;
    }
}
